#ifndef STOCK00_H_
#define STOCK00_H_

#include <string>

class Stock // class declaration
{
private:
    std::string company;
    long shares;
    double share_val;
    double total_val;
    void set_total() {total_val = share_val * shares; };
public:
    Stock(const std::string &co, long n, double pt);
    ~Stock();
    void acquire(const std::string &co, long n, double pr);
    void buy(long num, double price);
    void sell(long num, double price);
    void update(double price);
    void show() const;
    // 静态方法，通过Stock::printStr来调用
    static void printStr(const std::string &astr);
    // 静态属性，可以在静态方法中使用
    static bool isPrinted;
};
#endif
